/*
*
* */
Rsd.define('Rsd.Faith.pages.BankZengZhiPaiXiListPage', {
    extend: 'Rsd.Faith.pages.ListPage',
    requires: [
        'Rsd.controlEx.ComboBoxEnum',
        'Rsd.Faith.controls.XiaoQuInput',
        'Rsd.Faith.controls.SuoShuQiInput',
        'Rsd.Faith.controls.YinHangInput'],
    xtype: 'list-pai-xi',
    border: false,
    formTitle: '统筹划拨',
    searchColumns:[{name:'ZhangHuBianHao',text:'账户编号'}],
    newButtons:[{text:'统筹资金划拨',handler:'btn_new'}],
    modelType: 'BankZengZhiPaiXiModel',
    readOnly:false,
    sort:[{name:'KaiShiRiQi',direction:'desc'}],
    formFields: [
        {
            "name": "YinHangMingCheng",
            "label": {
                "width": 80,
                "content": "银行名称"
            },
            "dataIndex": "YinHangMingCheng",
            "index": 20,
            "exist": true,
            "xtype": "ctrl-yinhang",
            valueChanged:'yinhang_on_changed',
            "length": 100
        },
        {
            "name": "YinHangZhangHao",
            "label": {
                "width": 80,
                "content": "银行账号"
            },
            "dataIndex": "YinHangZhangHao",
            "index": 21,
            "exist": true,
            readOnly:true,
            "xtype": "text",
            "length": 20
        },
        {
            "name": "SuoShuQi",
            "label": {
                "width": 80,
                "content": "归属所属期"
            },
            "dataIndex": "SuoShuQi",
            "index": 26,
            "exist": true,
            "xtype": 'ctrl-suoshuqi',
            "length": 255
        },
        {
            "name": "XiaoQu",
            "label": {
                "width": 80,
                "content": "小区名称"
            },
            "dataIndex": "XiaoQu",
            "index": 23,
            "exist": true,
            "xtype":'ctrl-xiaoqu',
            valueChanged:'xiaoqu_on_changed',
            "length": 20
        },
        {
            "name": "XiaoQuBianHao",
            "label": {
                "width": 80,
                "content": "小区编号"
            },
            "dataIndex": "XiaoQuBianHao",
            "index": 22,
            "exist": true,
            readOnly:true,
            "xtype": "text",
            "length": 20
        },
        {
            "name": "LouDongHao",
            "label": {
                "width": 80,
                "content": "楼栋号"
            },
            "dataIndex": "LouDongHao",
            "index": 22,
            "exist": true,
            //readOnly:true,
            //"xtype": "combobox",
            "xtype": "text",
            "length": 20
        },
        {
            "name": "DanYuanHao",
            "label": {
                "width": 80,
                "content": "单元号"
            },
            "dataIndex": "DanYuanHao",
            "index": 22,
            "exist": true,
             //readOnly:true,
            //"xtype": "combobox",
            "xtype": "text",
            "length": 20
        },
        {
            "name": "ZhangHuBianHao",
            "label": {
                "width": 80,
                "content": "账户编号"
            },
            "dataIndex": "ZhangHuBianHao",
            "index": 22,
            "exist": true,
            //readOnly:true,
            "xtype": "text",
            "length": 20
        },

        {
            "name": "PaiXiJinE",
            "label": {
                "width": 80,
                "content": "划拨金额"
            },
            "dataIndex": "PaiXiJinE",
            "index": 28,
            "exist": true,
            "xtype": "number",
            "precision": 2
        },
        {
            "name": "ZhuangTai",
            "label": {
                "width": 80,
                "content": "状态"
            },
            "dataIndex": "ZhuangTai",
            "index": 30,
            "exist": true,
            "xtype": "text",
            "length": 10
        },
        {
            "name": "Remark",
            "label": {
                "width": 80,
                "content": "备注"
            },
            "dataIndex": "Remark",
            "index": 200,
            "exist": true,
            "xtype": "text",
            "length": 100
        }
    ],
    gridColumns: [
        {
            "text": "序号",
            "xtype": "index",
            "width": 40,
            "index": 0
        },
        {
            "name": "YinHangMingCheng",
            "dataIndex": "YinHangMingCheng",
            "sortable": false,
            "text": "银行名称",
            "index": 20,
            "exist": true,
            "xtype": "string",
            "width": 100,
            "nobr": true
        },
        {
            "name": "YinHangZhangHao",
            "dataIndex": "YinHangZhangHao",
            "sortable": false,
            "text": "银行账号",
            "index": 21,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "SuoShuQi",
            "dataIndex": "SuoShuQi",
            "sortable": false,
            "text": "归属所属期",
            "index": 26,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },

        {
            "name": "XiaoQuBianHao",
            "dataIndex": "XiaoQuBianHao",
            "sortable": false,
            "text": "小区编号",
            "index": 23,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },

        {
            "name": "LouDongHao",
            "dataIndex": "LouDongHao",
            "sortable": false,
            "text": "楼栋号",
            "index": 23,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "DanYuanHao",
            "dataIndex": "DanYuanHao",
            "sortable": false,
            "text": "单元号",
            "index": 23,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "ZhangHuBianHao",
            "dataIndex": "ZhangHuBianHao",
            "sortable": false,
            "text": "账户编号",
            "index": 23,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "PaiXiJinE",
            "dataIndex": "PaiXiJinE",
            "sortable": false,
            "text": "划拨金额",
            "index": 28,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ZhuangTai",
            "dataIndex": "ZhuangTai",
            "sortable": false,
            "text": "状态",
            "index": 30,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "Remark",
            "dataIndex": "Remark",
            "sortable": false,
            "text": "备注",
            "index": 200,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        }
    ],
    titleField : 'FaPiaoBianHao',

    /*
     * */
    constructor: function (config) {
        config = config || {};
        Rsd.apply(this, config);
    },
    /*
    * */
    xiaoqu_on_changed:function xiaoqu_on_changed(sender,e)
    {
        if(sender.valueItem)
        {
            sender.parent.parent.parent.setFieldValue('XiaoQuBianHao',sender.valueItem.key);
            Rsd.app.getService('info.getloudonglist',{'XiaoQuBianHao':sender.valueItem.key},function (data) {
                console.log(data);
            });
        }
        //
    },
    yinhang_on_changed:function yinhang_on_changed(sender,e) {
        if(sender.valueItem)
        {
            sender.parent.parent.parent.setFieldValue('YinHangZhangHao',sender.valueItem.key);
        }
    },
    btn_new:function btn_new() {

        this.newItem();
        //Rsd.create('Rsd.Faith.dialogs.BankZengZhiPaiXiDialog',{}).showDialog();
    }


});